﻿using FluentValidation;
using System.Collections.Generic;

namespace Jinjia.Approve.Model.Input.JJFlow
{
    /// <summary>
    /// 审批转交入参
    /// </summary>
    public class TransferFlowsInput
    {
        /// <summary>
        /// 实力任务ID
        /// </summary>
        public List<int> InstanceEmpIds { get; set; }

        /// <summary>
        /// 交接人
        /// </summary>
        public int HandoverUserId { get; set; }
    }

    public class TransferFlowsInputValidator : AbstractValidator<TransferFlowsInput>
    {
        /// <summary>
        /// 入参校验构造函数
        /// </summary>
        public TransferFlowsInputValidator()
        {
            RuleFor(x => x.HandoverUserId).Must(x => x > 0).WithMessage("请选择交接人！");
            RuleFor(x => x.InstanceEmpIds).NotNull().Must(x => x.Count > 0).WithMessage("请选择需要交接的单据！");
        }
    }
}
